import React from 'react';

class Search extends React.Component {
    constructor(props) {
        super(props);
        this.displayName = 'Search';
        this.state = {
            value: ''
        }
    }

    handleFocus(e) {
        console.log(e.currentTarget);
        let target = e.currentTarget;
        target.className= '';
    }

    handleSearchChange() {
        // console.log(this.state.value);
        this.setState({
            value: this.refs.searchInput.value
        });
    }

    render() {
        return (
            <div className="search">
                <input type="text" className="center" placeholder="请输入俱乐部名称" ref="searchInput" onFocus={this.handleFocus.bind(this)} onChange={this.handleSearchChange.bind(this)} value={this.state.value} />
            </div>
        );
    }
}

export default Search;
